Page({
  data: {
    tabs: [],
    activeTab: 0,
    yati:[
      {id:"1",name:"2020下中学教育知识与能力押题卷1",zhuangtai:["未作答","已完成"]},
      {id:"2",name:"2020下中学教育知识与能力押题卷2",zhuangtai:["未作答","已完成"]},
      {id:"3",name:"2020下中学教育知识与能力押题卷3",zhuangtai:["未作答","已完成"]}
    ],
    fenlei:[
      {name:"1-1"},
      {name:"1-2"},
      {name:"1-3"},
      {name:"1-1"},
    ]
  },

  yati:function(e){
    let id = e.currentTarget.dataset.id;
    if(id == 1){
      wx.redirectTo({
        url: '/pages/test_baby/test1/test1'
      })
    }else{
      wx.showToast({
        title: '此试卷尚未开放！',
        icon: "none"
      })
    }
  },

  fenlei:function(){
    wx.navigateTo({
      url: '/pages/test_baby/test4/test4'
    })
  },

  onLoad() {
    const titles = ['章节测试', '分类练习', '真题模拟', '押题冲刺','考场管理'];
    const tabs = titles.map(item => ({title: item}));
    this.setData({tabs})
  },

  onTabCLick(e) {
    const index = e.detail.index
    this.setData({activeTab: index})
  },

  onChange(e) {
    const index = e.detail.index
    this.setData({activeTab: index})
  }

})